Skip to content

feat: enrich event stream with Kit-managed userAttributes#80

Closed
crisryantan wants to merge 1 commit intomparticle-integrations:developmentfrom
crisryantan:feat/enrich-event-stream-user-attributes
Closed

feat: enrich event stream with Kit-managed userAttributes#80
crisryantan wants to merge 1 commit intomparticle-integrations:developmentfrom
crisryantan:feat/enrich-event-stream-user-attributes

Conversation

@crisryantan
Copy link
Copy Markdown
Contributor

Summary

  • Enriches events in _sendEventStream with the Kit's self.userAttributes before forwarding to window.Rokt.__event_stream__
  • Uses mergeObjects({}, event, { UserAttributes: self.userAttributes }) so the Kit's attributes always win (freshest source) and the original event is never mutated
  • This ensures the downstream Rokt SDK always receives up-to-date, Kit-filtered user attributes — covering edge cases where queued events may have stale or missing UserAttributes

Test plan

  • Added test: enriches event with Kit userAttributes before forwarding
  • Added test: Kit userAttributes override stale event-level UserAttributes
  • Added test: original event object is not mutated
  • Added test: empty userAttributes are passed through correctly
  • Updated existing forwarding assertion for enriched event shape
  • All 141 tests pass locally

Made with Cursor

Merge self.userAttributes onto events before forwarding to
__event_stream__ so the downstream SDK always receives fresh,
Kit-filtered user attributes regardless of event queuing state.

Made-with: Cursor
@crisryantan crisryantan marked this pull request as ready for review March 25, 2026 03:12
@jamesnrokt
Copy link
Copy Markdown

Closing as dupe of #79 as this is on a fork and can't be updated

@jamesnrokt jamesnrokt closed this Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants